package com.fengkai.filepost.pdfoutstream.test.ODsolutions;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * @author Fengkai 寻找两个数组最小和
 * @creat 2023/4/2
 */
public class FindTowArrayMinSum {

    public static int findTowArrayMinSum (int[] i1, int[] i2, int k) {
        int sum = 0;
        int[] ints1 = Arrays.copyOfRange(i1, 1, i1.length);
        int[] ints2 = Arrays.copyOfRange(i2, 1, i2.length);
        ArrayList<Integer> sums = new ArrayList<>();
        for (int i = 0; i < ints1.length; i++) {
            for (int j = 0; j < ints2.length; j++) {
                sums.add(ints1[i] + ints2[j]);
            }
        }

        List<Integer> collect = sums.stream().sorted((v1, v2) -> v1.compareTo(v2)).collect(Collectors.toList());
        for (int i = 0; i < k; i++) {
            sum += collect.get(i);
        }
        return sum;
    }

    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] s1 = s.split(" ");
        int[] ints = new int[s1.length];
        s = scanner.nextLine();
        String[] s2 = s.split(" ");
        int[] ints2 = new int[s2.length];
        for (int i = 0; i < s1.length; i++) {
            ints [i] = Integer.parseInt(s1[i]);
        }
        for (int i = 0; i < ints2.length; i++) {
            ints2 [i] = Integer.parseInt(s2[i]);
        }
        int k =Integer.parseInt(scanner.nextLine()) ;
        System.out.println(findTowArrayMinSum(ints, ints2, k));

    }
}
